package me.chendan.age

import java.io.PrintWriter

import scala.util.Random

/**
  * Created by chendan on 16-4-6.
  */
object PeopleInfoGenerator extends App{
  val nums: Int = args.length match {
    case i: Int if (i > 0) => Integer.parseInt(String.valueOf(args(0)))
    case _ => 10000000
  }

  val writer = new PrintWriter("people.txt")
  val rand = new Random()
  for (i <- 1 to nums) {
    writer.println(i + " " + (rand.nextInt(100) + 1))
  }
  writer.close()
  println("finished")
}
